Skip to content

Conversation

ks6088ts
Copy link
Member

What this PR does / why we need it

  • add environment variables for Otel

Which issue(s) this PR fixes:

Fixes #37

Does this introduce a breaking change?

[ ] Yes
[x] No

Pull Request Type

What kind of change does this Pull Request introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

How to Test

  • Get the code
ORGANIZATION=<organization-name>
REPOSITORY=<repository-name>

git clone [email protected]:$ORGANIZATION/$REPOSITORY.git
cd $REPOSITORY
  • Test the code
make ci-test

What to Check

Verify that the following are valid

  • ...

Additional Information

@ks6088ts ks6088ts requested a review from Copilot July 22, 2025 04:30
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds OpenTelemetry (OTel) environment variables for enhanced observability configuration and makes improvements to async handling in demo endpoints. The changes focus on standardizing telemetry configuration and fixing blocking operations in async functions.

  • Adds standardized OTel environment variables for service identification and sampling configuration
  • Replaces blocking time.sleep() calls with proper async asyncio.sleep() in demo endpoints
  • Enables live metrics in Azure Monitor configuration

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
.env.template Adds OTel environment variables for service configuration and Azure Application Insights connection
template_fastapi/app.py Enables live metrics in Azure Monitor configuration
template_fastapi/routers/demos.py Converts blocking sleep operations to async and adds additional processing simulation

await asyncio.sleep(sleep_ms / 1000.0) # Convert milliseconds to seconds
with tracer.start_as_current_span("child"):
logger.debug("Child span execution")
await asyncio.sleep(sleep_ms / 1000.0) # Simulate additional processing
Copy link
Preview

Copilot AI Jul 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding another sleep operation in the child span doubles the total execution time unexpectedly. This changes the API behavior significantly - callers expecting a sleep duration of X milliseconds will now experience 2X milliseconds. Consider removing this additional sleep or making it configurable.

Copilot uses AI. Check for mistakes.

@ks6088ts ks6088ts force-pushed the feature/issue-37_otel branch from 25d6a05 to 042cc3d Compare July 22, 2025 04:41
@ks6088ts ks6088ts merged commit 242deef into main Jul 22, 2025
4 checks passed
@ks6088ts ks6088ts deleted the feature/issue-37_otel branch July 22, 2025 04:55
@ks6088ts ks6088ts restored the feature/issue-37_otel branch July 22, 2025 04:55
@ks6088ts ks6088ts deleted the feature/issue-37_otel branch July 22, 2025 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support OTEL
1 participant